package Application.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import Application.dao.CollectDao;
import Application.entity.Collect;
import Application.entity.Result;
import Application.service.CollectService;
@Service("CollectService")
public class CollectServiceImpl implements CollectService {

	@Resource
	private CollectDao dao;
	@Override
	public Result addCollect(Collect collect) {
		Result r = new Result();
		try {
			dao.addCollect(collect);
			r.setContent(1);
		} catch (Exception e) {
			r.setContent(0);
		}
		return r;
	}

	@Override
	public Result removeCollect(int id) {
		Result r = new Result();
		try {
			dao.removeCollect(id);
			r.setContent(1);
		} catch (Exception e) {
			r.setContent(0);
		}
		return r;
	}

	@Override
	public List<Collect> findUserCollect(int id) {
		return dao.findUserCollect(id);
	}

}
